-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add spanning tree #135
add spanning tree #135
Conversation
解决了 #91 的问题。生成一棵树(或任意图),选一个点作为根节点即可。 |
d4744b3
to
2727298
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
去写test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cyaron的io对象好像不太能直接打印这种对象
那既然返回的数据还要用户处理
我觉得就没必要把处理边权的部分放进这里了吧
我不想动,先挂在那行吗? |
这么摆 那我看着改改了 |
好,支持直接打印了 |
实现太奇葩了 我再想想怎么搞合适 |
我先将内容放其他分支了, |
加入生成树,返回格式为(父,子)元组的列表
默认是从
1
开始执行 DFS(BFS 风格),可以通过指定容器实现 BFS 生成树或最小生成树。可以通过传入
from_weight
决定是否显示边权和如何显示,默认是lambda w: None
,即不显示。应该输出: